<script type="text/javascript" language="javascript">
	$(document).ready(function () {
		$.formValidator.initConfig({formID:"addIndustryForm",autoTip:false,onError:function(msg){alert(msg)},inIframe:true});
		 $("#industryName").formValidator({onShow:"请输入行业名", onFocus:"行业名不能为空",onCorrect: "　",defaultValue:""}).inputValidator({min:4,max:40,empty:{leftEmpty:false,rightEmpty:false,emptyError:"行业名两边不能有空符号"},onError:"您输入的字符长度非法,请确认"})
			.ajaxValidator({
			dataType : "html",
			type : "POST",
			async : true,
			url : "__URL__/checkIndustryName",
			success : function(data){
				if( data == '0' ) {return true};
				return false;
			},
			buttons: $("#button"),
			error: function(jqXHR, textStatus, errorThrown){alert("服务器没有返回数据，可能服务器忙，请重试");},
			onError : "该用行业名已存在，请直接选择",
			onWait : "正在对行业名进行合法性校验，请稍候..."
		});
	});	
</script>
<iframe src="" name="addIndustrys" style="display:none;" ></iframe>
<div style="float:left">
	<form name="addIndustry" method="post" action="__URL__/addIndustry" target="addIndustrys" id="addIndustryForm" >
    <table summary="添加行业信息" id="box-table-a">
	    <tr>
			<td>行业名称</td>
			<td><input name="industryName" type="text" id="industryName" /></td>
			<td><div id="industryNameTip" style="width:100px,height:20px" /></td>
	    </tr>
    </table>
	<p style="padding-top: 5px; padding-bottom: 5px; pading-left: 100px;"  >
        <input style="margin-left:145px;" type="submit" name="Button2" value="提交" class="input-button" />
		<input type="button" value="关闭" class="closeload input-button gray" />
	</p>
	</form>
</div>
<script type="text/javascript">
	function insertres(res,id,names){
		if(res){
			var oldhtml=$('#IndustryList').html();
			newhtml='<option value="'+id+'" selected="selected" >'+names+'</option>';
			$('#IndustryList').html(oldhtml+newhtml);
			$(".load_body").html("");
			$(".ajaxloadhtml").hide();
			alert(names+" 添加成功");
		}else{
			alert('添加失败');
		}
	}
</script>
